package com.sas.domain;

import java.util.Set ; 

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import org.hibernate.annotations.NaturalId;
import org.springframework.util.Assert;

@Entity
public class Seller extends PersistentEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 3733043726048243736L;
	@NaturalId
	private String firstName;
	@NaturalId
	private String lastName;
	
	@OneToMany
	@JoinColumn(name = "sellerId")
	private Set<Telephone> telephones;
	
	Seller(){
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		Assert.hasText(firstName);
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		Assert.hasText(lastName);
		this.lastName = lastName;
	}

	public Set<Telephone> getTelephones() {
		return telephones;
	}

	public void setTelephones(Set<Telephone> telephones) {
		Assert.notEmpty(telephones);
		this.telephones = telephones;
	}
}
